﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;
using DHQGHN.PM2.Models;

namespace DHQGHN.PM2.Security
{
    public class MyPrincipal : IPrincipal
    {
        public IIdentity Identity { get; private set; }

        public MyPrincipal(IIdentity identity)
        {
            this.Identity = identity;
        }

        public MyPrincipal(string userName)
        {
            this.Identity = new GenericIdentity(userName);
        }

        public bool IsInRole(string role)
        {
            if (Roles != null)
            {
                return Roles.Contains(role);
            }
            return false;
        }

        public List<string> Roles
        {
            get;
            set;
        }

        //list menu
        //public List<MenuModel> ListMenu { get; set; }

        public string UserName { get; set; }

        public string AdminCode { get; set; }

        public string AdminID { get; set; }

        public string AdminName { get; set; }

        public string FullName { get; set; }

        //phunx1, 20150702: lay them truong GroupCode tu bang ENUMERATOR
        public string GroupCode { get; set; }

        public string AppCode { get; set; }

        public int CountDay { get; set; }

        //public Guid APPLICATIONID { get; set; }
    }
}